package xx.notice.controller;

import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xx.notice.entity.NoteSource;
import xx.notice.entity.Result;
import xx.notice.entity.User;
import xx.notice.filter.SessionContent;
import xx.notice.service.NoteSourceService;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("notice")
public class NoticeController{

    @Resource
    NoteSourceService noteSourceService;

    /**
     * 发布通知
     * @return
     */
    @PostMapping("publish")
    public Result publish(@RequestBody NoteSource noteSource){
        //User user  = SessionContent.getUserInfoLocal();
        noteSource.setCreater("1");
        return noteSourceService.publishNotice(noteSource);
    }

}
